package com.castle.fortress.admin.flowable.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 审批流程
 * @author  castle
 */
@Getter
@AllArgsConstructor
public enum ApproveStatusEnum {

    APPROVED(1,"审批中","审批中"),
    FINISH(2,"已完成","已完成"),
    UNAPPROVED(3,"驳回申请","驳回申请"),
    CANCEL(4,"取消申请","取消申请"),
    PENDING(5,"待审批","待审批"),
    UNSUBMIT(6,"待提交","待提交"),
    ENDPRO(7,"结束流程","结束流程"),
    ;

    Integer code;
    String name;
    String desc;

    public static String getNameByCode(Integer code){
        for(ApproveStatusEnum e: ApproveStatusEnum.values()){
            if(e.getCode().equals(code)){
                return e.getName();
            }
        }
        return null;
    }
}
